package com.TechMahindra.wx.utils;

import java.util.Calendar;
import java.util.Date;

/**
 * 
 * @author weican
 */
public class DateUtils {
	
	
	/**
	 * 增加指定秒时间
	 * @param date
	 * @param second
	 * @return
	 */
	public static Date addDateSecond(Date date, int second){
		Calendar cal = Calendar.getInstance();
		cal.setTime(date);
		cal.add(Calendar.SECOND, second);
		return cal.getTime();
	}
	
	/**
	 * 增加指定秒时间
	 * @param date
	 * @param second
	 * @return
	 */
	public static Date addDateHour(Date date, int hour){
		Calendar cal = Calendar.getInstance();
		cal.setTime(date);
		cal.add(Calendar.HOUR_OF_DAY, hour);
		return cal.getTime();
	}
}
